//
//  IncumbentViewController.m
//  MyProject
//
//  Created by 石小强 on 2018/3/26.
//  Copyright © 2018年 yanjiaming. All rights reserved.
//

#import "IncumbentViewController.h"
#import "SearchCompanyViewController.h"
#import "SelectCityViewController.h"
#import "PositionSelectViewController.h"
#import "NSUDManager.h"
#import "AppDelegate.h"

@interface IncumbentViewController ()

@end

@implementation IncumbentViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"选择角色";
    
    self.shadowV.layer.shadowColor = [UIColor blackColor].CGColor;
    //    self.shadowV.layer.shadowOffset = CGSizeMake(4, 4);
    self.shadowV.layer.shadowOffset = CGSizeMake(0, 0);
    self.shadowV.layer.shadowOpacity = 0.2;
    self.shadowV.layer.shadowRadius = 10.f;
}


- (IBAction)companyBtnClick:(id)sender {
    SearchCompanyViewController *scVC = [[SearchCompanyViewController alloc] init];
    scVC.index = 1;
    scVC.companyOrCityBlock = ^(NSString *companyOrCity) {
        self.companyL.text = companyOrCity;
    };
    [self.navigationController pushViewController:scVC animated:YES];
}

- (IBAction)jobCateBtnClick:(id)sender {
    PositionSelectViewController *psVC = [[PositionSelectViewController alloc] init];
//    psVC.selectBlock = ^(NSString *job) {
//        self.jobCateL.text = job;
//    };
    psVC.selectBlock = ^(JobModel *job) {
        self.jobCateL.text = job.jobName;
    };
    [self.navigationController pushViewController:psVC animated:YES];
}

- (IBAction)jobAreaBtnClick:(id)sender {
    SelectCityViewController *scVC = [[SelectCityViewController alloc] init];
//    scVC.cityBlock = ^(NSString *city) {
//        self.jobAreaL.text = city;
//    };
    [self.navigationController pushViewController:scVC animated:YES];
}


- (IBAction)okBtnClick:(id)sender {
    UserModel *user = [NSUDManager currentUser];
    user.role = @"2";
    [NSUDManager setCurrentUser:user];
    
   [((AppDelegate *)[UIApplication sharedApplication].delegate) gotoHome];
    ((AppDelegate *)[UIApplication sharedApplication].delegate).tabbarController.selectedIndex = 1;
}

@end
